
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_base_plugin/flutter_base_plugin.dart';

class JdButton extends StatelessWidget {
  final Color color;
  final String text;
  final GestureTapCallback? onClick;
  double? height;
  final double width;
  double radius;

  JdButton({
     Key? key,
    this.color = Colors.black,
    this.text = "按钮",
    this.onClick,
     this.height,
    this.width = double.infinity,
    this.radius = 10,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (height == null) {
      height = 60.h;
    }
    return InkWell(
      onTap: onClick,
      child: Container(
        margin: EdgeInsets.all(5),
        padding: EdgeInsets.all(5),
        height: height,
        width: width,
        decoration: BoxDecoration(
            color: color, borderRadius: BorderRadius.circular(radius)),
        child: Center(
          child: Text(
            "${text}",
            style: TextStyle(color: Colors.white),
          ),
        ),
      ),
    );
  }
}
